package com.sy.simpleegg.platform.kkb.api

import com.sy.simpleegg.platform.kkb.bean.HeartResp
import com.sy.simpleegg.platform.kkb.bean.config.KkbGetPayCoinData
import com.sy.simpleegg.platform.kkb.bean.config.GetPayQrCodeData
import com.sy.simpleegg.platform.kkb.bean.config.WeCharConfigData
import com.sy.simpleegg.platform.kkb.network.base.BaseResult
import io.reactivex.Observable
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Header
import retrofit2.http.POST

interface IConfigApi {
    /**
     * 获得兑币机配置
     *
     * @param token token
     * @param map
     * @return
     */
    @POST("/Hardware/api/v1.0/Pay/GetExchangeConfig")
    fun getExchangeConfig(
        @Header("Authorization") token: String?,
        @Body map: Map<String?, @JvmSuppressWildcards Any?>?
    ): Observable<BaseResult<KkbGetPayCoinData?>?>?

    /**
     * 获得兑币机配置
     *
     * @param token token
     * @param map
     * @return
     */
    @POST("/Hardware/api/v1.0/Pay/GetExchangeConfig")
    fun getExchangeConfig(
        @Header("Authorization") token: String?,
    ): Observable<BaseResult<KkbGetPayCoinData?>?>?

    /**
     * 获取微信配置信息
     *
     * @param token token
     * @param map   订单信息
     * @return 订单号 支付二维码
     */
    @POST("/yunyouminipos/api/v1/CoinExchange/WxFacePayGetAuthInfo")
    fun getWeCharFacePayAuthInfo(
        @Header("Authorization") token: String?,
        @Body map: Map<String?, Any?>?
    ): Observable<BaseResult<WeCharConfigData?>?>?

    /**
     * 获取消费二维码
     *
     * @param token token
     * @param map
     * @return
     */
    @POST("/Hardware/api/v1.0/Public/QRCode")
    fun getQrCode(
        @Header("Authorization") token: String?,
        @Body map: Map<String?, @JvmSuppressWildcards Any?>?
    ): Observable<BaseResult<GetPayQrCodeData?>?>?

    /**
     * 设备心跳
     *
     * @param token token
     * @param map
     * @return
     */
    @POST("/Hardware/api/v1.0/Public/Heart")
    fun heart(
        @Header("Authorization") token: String?,
        @Body map: Map<String?, @JvmSuppressWildcards Any?>?
    ): Observable<BaseResult<HeartResp?>?>?

    /**
     * 连接测试
     *
     * @return
     */
    @GET("/Hardware/api/v1.0/Pay/ConnectTest")
    fun connectTest(): Observable<BaseResult<Any?>?>?
}